/**
 * 功能:实现发布微博的功能
 * 创建日期: 2012-03-16
 * 创建人: 全轩
 * 功能修正说明:
 * 		
 */
if(!this.UpdateStatusesHandler)
{
	this.UpdateStatusesHandler = {};
}

(function(){
	if(typeof UpdateStatusesHandler.Publish !== 'function')
	{
		UpdateStatusesHandler.Publish = function(e,callback)
		{
			var url = 'http://api.t.sina.com.cn/statuses/update.json?source='+SinaAuth.appKey+'&status='+ encodeURIComponent(UpdateStatuses.Content);
				
			var paras =[{'source':SinaAuth.appKey},{'status':UpdateStatuses.Content}];
			
			if(UpdateStatuses.Img != null)
			{
				url = 'http://api.t.sina.com.cn/statuses/upload.json';
				SinaAuth.RequestPOSTWithPic(url,paras,updatestatuses.Img,function(newstatues){
					UpdateStatuses.Img = null;
					if(typeof callback == 'fucntion'){
						callback(newstatues);
					}
				});
			}
			else
			{
				SinaAuth.RequestPOST(url,paras,function(newstatues){
					UpdateStatuses.Img = null;
					if(typeof callback == 'fucntion'){
						callback(newstatues);
					}
				});
			}
		}
	}
}())

//SinaApp.UpdateStatusesHandler = UpdateStatusesHandler;